<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateMenusTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('menus', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('name', 50)->comment('名称');
            $table->integer('pid')->default(0)->comment('父id');
            $table->string('route', 50)->default(null)->comment('路由');
            $table->timestamps();
            $table->softDeletes();
            $table->charset = 'utf8mb4';
            $table->engine = 'InnoDB';
            $table->autoIncrement = 1;
            $table->comment = '菜单表';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('menus');
    }
}
